import request from '@/utils/request'




// 查询所有管理员
export function getManagers (params) {
    return request({
        params,
        url: 'back/manager/list',

    })
}

// 添加管理员
export function createManager (data) {
    return request({
        method: 'post',
        data,
        url: '/back/manager/addManager',
    })
}


// 管理员编辑
export function editManager (managerId,userName) {
    return request({
        method: 'put',
        url: `/back/manager/updateManager/${managerId}?userName=${userName}`
    })
}


// 管理员删除
export function deleteManager (managerId) {
    return request({
        method: 'delete',
        url: `/back/manager/delManager?id=${managerId}`
    })
}

// 管理员状态修改
export function managerStatus (id,status) {
    return request({
        method: 'post',
        url: `/back/manager/updateStatus/${id}?status=${status}`,
    })
}
// 给管理员分配角色
export function assignRole (params) {
    return request({
        method: 'post',
        params,
        url: `/back/manager/role/update`,
    })
}
// 获取当前管理员所拥有的角色
export function getManagerRole (managerId) {
    return request({
        method: 'get',
        url: `/back/manager/get/${managerId}`,
    })
}




